package array.average;

import java.util.Scanner;

public class ArrayAverage {
 
    public static void main(String[] args) {
        Scanner keyboard=new Scanner(System.in);
        int var;
        System.out.println("input number of numbers.");
        var=keyboard.nextInt();
        int array[]=new int[var];
              int i;
        for(i=0;i<array.length;i++)
                {
                    System.out.println("Input number " + (i + 1));
                    array[i]=keyboard.nextInt();
                }
        i=0;
        System.out.println("");
        for(int n=array.length-1;n>=0;n--)
        {
            
            System.out.println(array[n]);
            
        }
        for(int n=array.length-1;n>=0;n--)
        {
            i=i+array[n];
        }
        float purple=i;
        float pasta=array.length;
        float average=purple/pasta;
        System.out.println("sum:" + i);
        System.out.println("average:" + average);
    }
}
